<?php
  include_once('../includes/eac_curl.class.php');
  include_once("../includes/mod_globals.inc.php");

	/**
	* check whether the website has a verfied image,used for checking whether the user is webmaster
	*/
	function hasVerifyImage($puri){
		global 	$VERIFY_MOTHER_IMAGE_NAME ,$_DEBUG;

		$pverify_site_image_path = $puri.$VERIFY_MOTHER_IMAGE_NAME;
		$http = new cURL();
		$result = $http->get($pverify_site_image_path);
		if ($http->success){
			$info = $http->getInfo();
			if($info['http_code'] == 200 && $info['url'] == $pverify_site_image_path){ //ok && prevent evil redirect 
				return true;
			}
		}
		if ($_DEBUG){
			echo "<pre>";
			print_r($http->getHeaders());
			print_r($http->getInfo());
			print_r($http->getOptions());
			echo "</pre>";
		}
		return false;
	}
?>